// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 多文件上传 POST /file/batch/upload */
export async function fileUpload1(body: {}, options?: { [key: string]: any }) {
  return request<API.FileInfo[]>('/file/batch/upload', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 文件读取 GET /file/read */
export async function readFile(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.readFileParams,
  options?: { [key: string]: any },
) {
  return request<any>('/file/read', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 单文件上传 POST /file/upload */
export async function fileUpload(body: {}, options?: { [key: string]: any }) {
  return request<API.FileInfo>('/file/upload', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
